package Work2;
import java.util.*;
/*
 *@Student 张策
 */
public class work3 {
    public static void main(String[] args) {
        Map map=new HashMap();
        map.put("jack",650);
        map.put("tom",1200);
        map.put("smith",2900);
//        for (Object object :map.keySet()) {
//            map.put(object,(int)map.get(object)+100);
//        }
//        TreeSet treeSet = new TreeSet();
//        treeSet.add(new work("a",1));
//        System.out.println(map);
//        Set set = map.entrySet();
//        for (Object object :set) {
//            Map.Entry o=(Map.Entry) object;
//            System.out.println(o);
//        }
//        Iterator iterator = set.iterator();
//        while (iterator.hasNext()) {
//            System.out.println(iterator.next());
//        }
//        Set set = map.keySet();
//        Iterator iterator = set.iterator();
//        while (iterator.hasNext()) {
//            Object next = iterator.next();
//            System.out.println(next);
//        }
//        System.out.println(map);
//        Collection values = map.values();
//        Iterator iterator = values.iterator();
//        while (iterator.hasNext()) {
//            Object next =  iterator.next();
//            System.out.println(next);
//        }
    }
}
class work{
    private String name;
    private int money;

    public work(String name, int money) {
        this.name = name;
        this.money = money;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getMoney() {
        return money;
    }

    public void setMoney(int money) {
        this.money = money;
    }

    @Override
    public String toString() {
        return "work{" +
                "name='" + name + '\'' +
                ", money=" + money +
                '}';
    }
}
